import { S } from '../../s';
import { IPSDBSysPortletPart } from './ipsdbsys-portlet-part';
import { PSDBPortletPartImpl } from './psdbportlet-part-impl';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysCss } from '../../res/ipssys-css';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { IPSSysUniRes } from '../../security/ipssys-uni-res';

export class PSDBSysPortletPartImpl
  extends PSDBPortletPartImpl
  implements IPSDBSysPortletPart
{
  get codeName(): string {
    return this.M.codeName;
  }

  get height(): number {
    return this.M.height;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  protected pssysunires: IPSSysUniRes;
  getPSSysUniRes(): IPSSysUniRes | null {
    return (
      this.pssysunires ||
      (this.pssysunires = this.fillObjectModel(
        S._284,
        this.M.getPSSysUniRes,
        S._32d,
      ) as IPSSysUniRes)
    );
  }

  get portletType():
    | 'LIST'
    | 'CHART'
    | 'VIEW'
    | 'HTML'
    | 'TOOLBAR'
    | 'ACTIONBAR'
    | 'CUSTOM'
    | 'APPMENU'
    | 'CONTAINER'
    | 'RAWITEM' {
    return this.M.portletType;
  }

  get timer(): number {
    return this.M.timer != null ? this.M.timer : 0;
  }

  get title(): string {
    return this.M.title;
  }

  protected titlepslanguageres: IPSLanguageRes;
  getTitlePSLanguageRes(): IPSLanguageRes | null {
    return (
      this.titlepslanguageres ||
      (this.titlepslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTitlePSLanguageRes,
        S._2b1,
      ) as IPSLanguageRes)
    );
  }
  get cls(): string {
    return 'PSDBSysPortletPartImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._229) return true;
    return super.instanceof(cls);
  }
}
